// 与文章相关的接口函数
import { request } from "@/utils"

// 获取文章频道
export const getChannelListAPI = async () => await request.get('/channels')

// 提交文章表单
export const createArticleAPI = async data => await request.post('/mp/articles?draft=false', data)

// 获取文章列表
export const getArticleListAPI = async params => await request.get('/mp/articles', { params })

// 获取文章列表
export const delArticleListAPI = async id => await request.delete(`mp/articles/${id}`)

// 文章数据回显
export const getArticleDetailAPI = async id => await request.get(`mp/articles/${id}`)

// 文章数据回显
export const editArticleDetailAPI = async (data) => await request.put(`mp/articles/${data.id}?draft=false`, data)